{
	template:`
	<a-page-header title="查看权限">
		<a-card :hoverable="true" :bodyStyle="{padding:'20px',lineHeight:1.8}">
			<a-row :gutter="10">
				<a-col span="14">
				    <div style="max-height:500px;overflow:auto;">
                        <div v-for="module in modules">
                            <div>
                                <m-icon :name="module.icon||'icon-more'" size="19"></m-icon>
                                &nbsp;{{module.name}}
                            </div>
                            <div v-for="menu in module.menus" style="padding-left:20px;">
                                <div>
                                    <m-icon :name="menu.icon||'icon-more'" size="17"></m-icon>
                                    &nbsp;{{menu.name}}
                                    <small style="color:#888;">{{menu.desc}}</small>
                                </div>
                                <div v-for="item in menu.menus" style="padding-left:20px;">
                                    <div>
                                        <m-icon :name="item.icon||'icon-more'"></m-icon>
                                        &nbsp;{{item.name}}
                                        <small style="color:#888;">{{item.desc}}</small>
                                    </div>
                                </div>
                            </div>
                        </div>
					</div>
				</a-col>
				<a-col span="10">
				    <div style="max-height:500px;overflow:auto;">
                        <a-divider orientation="left">归属</a-divider>
                        <div v-for="item in groupList">
                            <div v-if="item.type!='C'">
                                [{{typeNames[item.type]}}]&nbsp;{{item.name}}&nbsp;<small v-if="item.status=='9'" style="color:#f00">停用</small>
                                <a-tag color="success">包含</a-tag>
                            </div>
                        </div>
                        <div v-for="item in groupList">
                            <div v-if="item.type=='C'">
                                [{{typeNames[item.type]}}]&nbsp;{{item.name}}&nbsp;<small v-if="item.status=='9'" style="color:#f00">停用</small>
                                <a-tag v-if="item.oid==loginOrgOid" color="success">当前查看</a-tag>
                                <a-tag v-else color="processing" @click="selectOrgOid(item.oid)">切换查看</a-tag>
                            </div>
                        </div>
                        <a-divider orientation="left">权限</a-divider>
                        <template v-for="item in powerList">
                            <div>
                                <span v-text="toDesc0(item)"></span>
                                <small style="color:#888;" v-text="toDesc1(item)"></span>
                            </div>
                        </template>
					</div>
				</a-col>
			</a-row>
		</a-card>
	</a-page-header>
	`,
	props: ['localeZh','param','parentVue'],
	data:function(){
		return {
			adminOid:'',
			modules:{},
			powerList:[],
			typeNames:{'A':'组','B':'角色','C':'机构'},
			loginOrgOid:'',
			groupList:[]
		};
	},
	mounted(){
		this.adminOid=this.param.adminOid;
		this.requestData("action/manage/adminGroup/getGroup4Admin",
			{adminOid:this.adminOid},
			function(data){
				if(data.code==0){
					this.groupList=data.groupList;
					for(let i=0;i<this.groupList.length;i++){
					    let g=this.groupList[i];
					    if(g.type=='C'){
					        this.loginOrgOid=g.oid;
					        break;
					    }
					}
                    this.loadMenuPower();
				}else{
					this.remind().error(data.msg);
				}
			}.bind(this)
		);
	},
	methods:{
	    selectOrgOid:function(orgOid){
	        this.loginOrgOid=orgOid;
	        this.loadMenuPower();
	    },
	    loadMenuPower:function(){
            this.requestData("action/manage/groupMenuLink/getModuleList4Admin",
                {adminOid:this.adminOid,groupOid:this.loginOrgOid},
                function(data){
                    if(data.code==0){
                        this.modules=data.modules;
                    }else{
                        this.remind().error(data.msg);
                    }
                }.bind(this)
            );
            this.requestData("action/manage/adminGroupPower/getPower4Admin",
                {adminOid:this.adminOid,groupOid:this.loginOrgOid},
                function(data){
                    if(data.code==0){
                        this.powerList=data.powers;
                    }else{
                        this.remind().error(data.msg);
                    }
                }.bind(this)
            );
	    },
        toDesc0:function(str){
            var arr=str.split("|");
            return arr[0];
        },
        toDesc1:function(str){
            var arr=str.split("|");
            return arr.length>1?arr[1]:'';
        }
	}
}